<div id="manager">
    <div>
        <div id="bg-title1"><img src="/images/bg-title1.jpg" alt=""></div>
        <div id="bg-title2"><img src="/images/icon-title.jpg" alt="" style="margin-right: 8px;">Danh sách quyền: <b><?=$user['name'] ?></b></div>
        <div id="bg-title3"><img src="/images/bg-title3.jpg" alt=""></div>
    </div>
    <div id="content">
        <div class="area-content1">
            <form name="frmEditUser" method="post" action="/admin/setperm?id=<?=$user['id'] ?>">
                <div class="form">
                    <div class="form1"><b>Nhóm</b></div>
                    <div class="form1"><?php
                        for($i =0; $i < sizeof($arrGroup); $i ++){?>
                            <div><?=$arrGroup[$i]['name']?></div><?
                        }?>
                    </div>
                    <div class="clearfloat"></div>
                </div>
                <div class="form">
                    <table class="datagrid" width="100%" cellspacing="1" border="0">
                        <tbody>
                            <tr>
                                <th class="cellleft">Quyền</th>
                                <th width="30">&nbsp;</th>
                            </tr><?php
                            foreach($modules AS $module){?>
                                <tr>
                                    <td class="cellleft" colspan="5" bgcolor="#f1f1f1"><b><?=ucfirst($module['name']) ?></b></td>
                                </tr><?php
                                foreach($module['actions'] AS $action){?>
                                    <tr>
                                        <td class="cellleft"><?=$action['description'] ?></td>
                                        <td style="text-align:center;"><?php
                                            $count = 0;
                                            for($k =0; $k < sizeof($peradmin); $k ++){
                                                if($peradmin[$k]['action_id'] == $action['id'] && $peradmin[$k]['permission'] == 1){
                                                    $count ++;
                                                }
                                            }
                                            if($count > 0){?>
                                                <span style="color:green;font-size:32px;text-align:center;">●</span><?php
                                            }else{?>
                                                <span style="color:lightgray;font-size:32px;text-align:center;">●</span><?php
                                            }?>
                                        </td>
                                    </tr><?php
                                }
                            }?>
                        </tbody>
                    </table>
                </div>
                <div align="right" class="form">
                    <span style="color:green;font-size:25px;text-align:center;">●</span> Có quyền
                    <span style="color:lightgray;font-size:25px;text-align:center;">●</span> Không có quyền
                </div>
            </form>
            <div class="clearfloat"></div>
       </div>
   </div>
</div>
<div class="clearfloat"></div>
